package com.xqyq.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.Table;
import javax.persistence.Transient;

@Entity
@Table(name = "user")
public class User {
	private int use_id;
	// 用户名
	private String user_name;
	// 头像
	private String head_photo;
	// 电话
	private String phone;
	// 邮箱
	private String mail;
	// 密码
	private String password;

	// 详细地址
	private String detailaddress;
	// 学校
	private String university;
	// 个人简介,个人页面的介绍，注册时候不用录入，个人详情页使用
	private String profile;
	// 毕业年份
	private int graduate_year;

	@Transient
	private String province;
	@Transient
	private String city;
	@Transient
	private String county;

	// 真名
	private String trueName;

	// 专业
	private String major;

	// 学院
	private String academy;

	// 学号
	private String studentId;

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	public int getUse_id() {
		return use_id;
	}

	public void setUse_id(int use_id) {
		this.use_id = use_id;
	}

	@Column(length = 20)
	public String getUser_name() {
		return user_name;
	}

	public void setUser_name(String user_name) {
		this.user_name = user_name;
	}

	@Column(length = 20)
	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	@Column(length = 30, nullable = false)
	public String getMail() {
		return mail;
	}

	public void setMail(String mail) {
		this.mail = mail;
	}

	@Column(length = 25, nullable = false)
	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	@Column(length = 20, nullable = false)
	public String getUniversity() {
		return university;
	}

	public void setUniversity(String university) {
		this.university = university;
	}

	@Column(length = 20)
	public int getGraduate_year() {
		return graduate_year;
	}

	public void setGraduate_year(int graduate_year) {
		this.graduate_year = graduate_year;
	}

	@Column(columnDefinition = "text")
	public String getProfile() {
		return profile;
	}

	public void setProfile(String profile) {
		this.profile = profile;
	}

	@Lob
	@Column(columnDefinition = "longtext")
	public String getHead_photo() {
		return head_photo;
	}

	public void setHead_photo(String head_photo) {
		this.head_photo = head_photo;
	}

	@Column(length = 100)
	public String getDetailaddress() {
		return detailaddress;
	}

	public void setDetailaddress(String detailaddress) {
		this.detailaddress = detailaddress;
	}

	@Column(length = 20, nullable = false)
	public String getTrueName() {
		return trueName;
	}

	public void setTrueName(String trueName) {
		this.trueName = trueName;
	}

	@Column(length = 20, nullable = false)
	public String getMajor() {
		return major;
	}

	public void setMajor(String major) {
		this.major = major;
	}

	@Column(length = 20, nullable = false)
	public String getAcademy() {
		return academy;
	}

	public void setAcademy(String academy) {
		this.academy = academy;
	}

	@Column(length = 20)
	public String getStudentId() {
		return studentId;
	}

	public void setStudentId(String studentId) {
		this.studentId = studentId;
	}

	public String getProvince() {
		return province;
	}

	public void setProvince(String province) {
		this.province = province;
	}

	public String getCity() {
		return city;
	}

	public void setCity(String city) {
		this.city = city;
	}

	public String getCounty() {
		return county;
	}

	public void setCounty(String county) {
		this.county = county;
	}

	@Override
	public String toString() {
		return "User [use_id=" + use_id + ", user_name=" + user_name
				+ ", head_photo=" + head_photo + ", phone=" + phone + ", mail="
				+ mail + ", password=" + password + ", detailaddress="
				+ detailaddress + ", university=" + university + ", profile="
				+ profile + ", graduate_year=" + graduate_year + ", province="
				+ province + ", city=" + city + ", county=" + county
				+ ", trueName=" + trueName + ", major=" + major + ", academy="
				+ academy + ", studentId=" + studentId + "]";
	}

}
